UserCheckLoginPlugin = Class.extend({
	/**
	 * This method is called right after the plugin is initialized
	 */
	onBegin: function(eventData)	{
		var properties = SingletonFactory.getInstance(Application).getSystemProperties();
		var loggedIn = properties.get('user.login');
		var obj = this;
		this.onAjax('user', 'check-login', {}, 'GET', 
			{'onSuccess': function(ret)	{
				if (ret == 0)	{
					properties.set('user.login', 0, true);
					var subject = SingletonFactory.getInstance(Subject);
					subject.notifyEvent('RequestRoute', new Request('Login'));
				} else {
					properties.set('user.id', ret.userid, true);
					properties.set('user.name', ret.name, true);
					properties.set('user.login', 1, true);
				}
			}
		});
	}
}).implement(PluginInterface).implement(AjaxInterface);